Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

Address RTL issues with SideMenu library #355

Closed
wants to merge 3 commits into from

Conversation

colmbrady
Copy link

Related to #305

Ive noticed a number of issues with this library when running inside a React Native RTL app (web and native).

This P.R addresses a number of those issues:

notably:

  • added the concept of 'start' and 'end' directions in favour of 'right' and 'left' as when RTL is active, left becomes right, so start and end is probably a better term to use. (this requires a RN bump to 0.51 - happy to remove this feature if its not desirable)
  • add a function which helps calculate the content panel offset base on RTL direction
  • add a function which calculates the menu boundary styles based on direction

…n RTL mode, the menu does not correctly render. It should render at the start of the viewport, which would be on the right in RTL mode. Instead it continues to render on the left.

`left` and `right` positions are misleading in this library. The intention of `left` and `right` (as per how its coded) is to behave more like `start` and `end` in React Native.

- This commit adds some new menuPosition props options for `start` and `end` which are intended to deprecate `left` and `right`.
- It also adds a new function to allow calculating whether we should consider the menuPosition as at the 'start' of the viewport which will be left in LTR mode and right in RTL mode.
- It also adds a function which uses this new calculation to decide what side the menu should be rendered on.
…hanges. This makes the drawer component responsive.
@colmbrady colmbrady closed this Aug 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant